/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

/**
 * <p>Project: jse2303 - For4
 * <p>Powered by webrx On 2023-07-11 15:30:38
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class For9 {
    public static void main(String[] args) {
        //循环语句中出现的break 退出循环 continue（结束本次循环，立即开始下一次）语句
        int sum = 0;
        for (int i = 1; i < 20; ++i) {
            if (i % 2 == 0) {
                continue;
            }

            sum += i; //1 3 5 7 9 11 13 15 17
            System.out.println(i);
            if (i > 15) {
                break;
            }
        }
        System.out.println("---------------");
        System.out.println(sum);
        System.out.println(1 + 3 + 5 + 7 + 9 + 11 + 13 + 15 + 17);
    }
}
